package com.zou.mall.product.config;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;


/**
 * 整合mybatisplus步骤
 * 1. 导入pom.xml坐标依赖
 * 2. application.yml配置数据源和xml存放路径
 * 3. MapperScan扫包
 */

@Configuration
@EnableTransactionManagement//开启事务
@MapperScan("com.zou.mall.product.dao")
public class MybatisConfig {

    /**
     * 分页插件
     */
    @Bean
    public PaginationInterceptor paginationInterceptor() {
        return new PaginationInterceptor();
    }

}